<html>
<body>
<table>
<tr>
<th>ID</th>
<th>Title</th>
<th>Year</th>
<th>Author</th>
<th>DOI</th>
<th>ZMath</th>
<th>Arxiv</th>
<th>Journal</th>
<th>Volume</th>
<th>Number</th>
<th>Pages</th>
<th>Month</th>
<th>Other</th>
</tr>
<?php
/*THIS IS A PROTOTYPE AND NOT INTENDED FOR USE IN FINISHED SYSTEM*/

/*Connecting to database*/
$con = mysqli_connect("127.0.0.1", "ref", "test", "isgci");

/*Handling connection errors*/
if (mysqli_connect_errno()) {
    echo "Failed to connect to MySQL: " . mysqli_connect_error();
} else
{
    /*SQL for fetching the whole references table*/
    $sql = "SELECT * FROM `references`";
    /*Fetching reference table*/
    $result = mysqli_query($con,$sql);
    /*Handling fetching errors*/
    if (!$result) {
        die('Error: ' .mysqli_error($con));
    }
    /*Filling table with content*/
    while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
        echo "<tr>";
        echo "<td>".$row['id']."</td>";
        echo "<td>".$row['title']."</td>";
        echo "<td>".$row['year']."</td>";
        echo "<td>".$row['author']."</td>";
        echo "<td>".$row['doi']."</td>";
        echo "<td>".$row['zmath']."</td>";
        echo "<td>".$row['arxiv']."</td>";
        echo "<td>".$row['journal']."</td>";
        echo "<td>".$row['volume']."</td>";
        echo "<td>".$row['number']."</td>";
        echo "<td>".$row['pages']."</td>";
        echo "<td>".$row['month']."</td>";
        echo "<td>".$row['other']."</td>";
        echo "</tr>";
    }
    /*Closing connection to database*/
    mysqli_close($con);
}
?>
</table>
<style>
th, td
    {
        padding:15px;
        border: 1px solid black;
        border-collapse:collapse;
    }
</style>

</body>
</html>